//
//  MBBaseHttpClient.h
//  MBObjectServer
//
//  Created by admin on 3/3/14.
//  Copyright (c) 2014 MBpayer. All rights reserved.
//

#import "AFNetworking.h"

#import "AFHTTPClient.h"


@class MBBaseHttpClient;

@protocol MBBaseHttpClientDelegate<NSObject>
-(void)MBBaseHttpClient:(MBBaseHttpClient *)client WithPath:(NSString *)path didUpdateWithData:(id)operationdata;
-(void)MBBaseHttpClient:(MBBaseHttpClient *)client WithPath:(NSString *)path didFailWithError:(NSError *)error;
@end

@interface MBBaseHttpClient : AFHTTPClient

@property(strong) id<MBBaseHttpClientDelegate> delegate;
    
+(MBBaseHttpClient *)sharedMBBaseHttpClient;
+(MBBaseHttpClient *)sharedPayHttpClient;
-(void)updateDataWithPath:(NSString *)path withAction:(NSString *)actionName WithParameters:(NSDictionary *)parameters;
-(void)postDataWithPath:(NSString *)path  withAction:(NSString *)actionName WithParameters:(NSDictionary *)parameters;
//直接转化json数据
-(void)getJsonDataWithPath:(NSString *)path withAction:(NSString *)actionName WithParameters:(NSDictionary *)parameters;
    
-(void)postDataWithPath:(NSString *)path  withAction:(NSString *)actionName WithParameters:(NSDictionary *)parameters block:(void(^)(id json))processResult failblock:(void(^)(NSError *error))failresult;
@end

